﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AttachmentList.ascx.cs" Inherits="DMS.Web.Modules.ArchivesManagement.AttachmentList" %>
<%@ Register Src="~/Common/Controls/Loading.ascx" TagName="Loading" TagPrefix="uc1" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="diy" %>
<script type="text/javascript">
    var ArchivesID = '<%=ArchivesID %>';

    function getClientId() {
        return {
            btnSearch: '#<%= btnSearch.ClientID %>'
        };
    }

    function printImg(imgUrl) {
        window.open("PrintImg.aspx?imgUrl="+imgUrl);
    }
</script>

<script type="text/javascript" src="/Modules/ArchivesManagement/Scripts/AttachmentList.js"></script>

    <%--<div class="search">
                <!----------- 查询信息 ------------------>
                <table width="100%" cellpadding="0" cellspacing="0" style="padding: 5 0 5 5">
                    <tr>
                        <td class="form">
                            <table cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <th>
                                        所属年月：
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlBelongYear" runat="server" Width="55px">
                                            <asp:ListItem Value="" Text="全部"></asp:ListItem>
                                            <asp:ListItem Value="2011" Text="2011"></asp:ListItem>
                                            <asp:ListItem Value="2010" Text="2010"></asp:ListItem>
                                            <asp:ListItem Value="2009" Text="2009"></asp:ListItem>
                                            <asp:ListItem Value="2008" Text="2008"></asp:ListItem>
                                            <asp:ListItem Value="2007" Text="2007"></asp:ListItem>
                                            <asp:ListItem Value="2006" Text="2006"></asp:ListItem>
                                            <asp:ListItem Value="2005" Text="2005"></asp:ListItem>
                                            <asp:ListItem Value="2004" Text="2004"></asp:ListItem>
                                            <asp:ListItem Value="2003" Text="2003"></asp:ListItem>
                                            <asp:ListItem Value="2002" Text="2002"></asp:ListItem>
                                            <asp:ListItem Value="2001" Text="2001"></asp:ListItem>
                                        </asp:DropDownList>
                                        年
                                        <asp:DropDownList ID="ddlBelongMonth" runat="server" Width="50px">
                                            <asp:ListItem Value="" Text="全部"></asp:ListItem>
                                            <asp:ListItem Value="1" Text="1"></asp:ListItem>
                                            <asp:ListItem Value="2" Text="2"></asp:ListItem>
                                            <asp:ListItem Value="3" Text="3"></asp:ListItem>
                                            <asp:ListItem Value="4" Text="4"></asp:ListItem>
                                            <asp:ListItem Value="5" Text="5"></asp:ListItem>
                                            <asp:ListItem Value="6" Text="6"></asp:ListItem>
                                            <asp:ListItem Value="7" Text="7"></asp:ListItem>
                                            <asp:ListItem Value="8" Text="8"></asp:ListItem>
                                            <asp:ListItem Value="9" Text="9"></asp:ListItem>
                                            <asp:ListItem Value="10" Text="10"></asp:ListItem>
                                            <asp:ListItem Value="11" Text="11"></asp:ListItem>
                                            <asp:ListItem Value="12" Text="12"></asp:ListItem>
                                        </asp:DropDownList>
                                        月
                                    </td>                                    
                                    <th>
                                        档案名称：
                                    </th>
                                    <td>
                                        <asp:TextBox TextMode="MultiLine" Height="22px" ID="txtName" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th style="width: 100px">
                                         档案类型：
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="txtType" runat="server" Width="150px">
                                            <asp:ListItem Value="" Text="全部"></asp:ListItem>
                                            <asp:ListItem Value="DJ" Text="登记类"></asp:ListItem>
                                            <asp:ListItem Value="ZJ" Text="征缴类"></asp:ListItem>
                                            <asp:ListItem Value="ZH" Text="综合类"></asp:ListItem>                        
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        形成日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtInitDateBegin" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                        至
                                        <asp:TextBox ID="txtInitDateEnd" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                    <th>
                                        保管起始日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtBeginTimeBegin" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                        至
                                        <asp:TextBox ID="txtBeginTimeEnd" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                    <th>
                                        到期日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtExpireTimeBegin" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                        至
                                        <asp:TextBox ID="txtExpireTimeEnd" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <th style="width: 100px">
                                         姓名：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtPersonName" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th>
                                        是否销毁：
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlDestroy" runat="server" Width="50px">
                                            <asp:ListItem Text="全部"></asp:ListItem>
                                            <asp:ListItem Value="True" Text="是"></asp:ListItem>
                                            <asp:ListItem Value="False" Selected="True" Text="否"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <th>
                                       
                                    </th>
                                    <td>
                                       
                                    </td>
                                </tr>
                                
                            </table>
                        </td>
                    </tr>
                </table>
            </div>--%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <a onclick="uploadFile(ArchivesID);" id="MainHolder_btnSearch" runat="server" class="linkbtn _searchBtn" href="#"><span>上传附件</span></a>
        <asp:LinkButton CssClass="linkbtn _searchBtn" style="display: none" ID="btnSearch" OnClick="btnSearch_Click" runat="server"><span>查询</span></asp:LinkButton>
        <!----------- 数据列表 ------------------>
            <asp:GridView ID="attachmentList" runat="server" class="dg_borderstyle" AutoGenerateColumns="False" 
                CellPadding="0" CellSpacing="1" border="0" ShowHeaderWhenEmpty="true" OnRowCommand="DealCommand" 
                AlternatingRowStyle-CssClass="dg_alternatingitemstyle" AllowSorting="True" OnSorting="GridView1_Sorting"
                RowStyle-CssClass="dg_itemstyle" onrowdatabound="List_RowDataBound">
                <HeaderStyle CssClass="dg_headerstyle"></HeaderStyle>
                <Columns>
                    <asp:BoundField DataField="ArchivesID" HeaderText="资料信息ID" Visible="false"/>
                    <asp:TemplateField ItemStyle-Width="20px" Visible="false">
                        <ItemTemplate>
                            <input id="chkItem" class="_selectItem" runat="server" type="checkbox" value='<%# DataBinder.Eval(Container, "DataItem.ArchivesID").ToString()%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="缩略图(点击切换) ">
                        <ItemTemplate>
                            <%--src="../../Attachments/<%# Eval("AttachURL") %>" --%>
                            <img oldwidth="100px" oldheight="" status="0"
                                style="cursor:pointer" width="100" onclick="changeSize(this);" runat="server" ID="imgUrlFiled"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:HyperLinkField DataNavigateUrlFields="AttachURL" DataNavigateUrlFormatString="../../Attachments/{0}"
                        DataTextField="AttachName" HeaderText="扫描件名称" Target="_blank" SortExpression="AttachName"/>
                    <asp:BoundField DataField="CreateTime" HeaderText="上传日期" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" SortExpression="CreateTime"/>
                    <asp:BoundField DataField="CreatorName" HeaderText="上传人" SortExpression="CreatorName"/>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <%--href='<%#"javascript:printImg(\"../../Attachments/" + Eval("AttachURL") + "\")"%>'--%>
                            <a runat="server" ID="printBtn"><span>打印</span></a>
                            <a href='<%#"../../Attachments/" + Eval("AttachURL")%>' target="_blank"><span>下载</span></a>
                            <asp:LinkButton CommandArgument='<%#Eval("AttachID") %>' OnClientClick="return deleteConfirm();" CommandName="DeleteAttachment" runat="server" ID="btnDelete"><span>删除</span></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="AttachURL" HeaderText="AttachURL" Visible="false"/>
                </Columns>
            </asp:GridView>
            <!--分页-->
            <table width="100%">
                <tr>                    
                    <td Width="85%">
                        <diy:AspNetPager ID="pager" runat="server" AlwaysShow="true" OnPageChanged="pager_PageChanged"
                            Width="100%" ShowPageIndexBox="Always" PageIndexBoxType="TextBox" TextBeforePageIndexBox="转到"
                            TextAfterPageIndexBox="页" ShowCustomInfoSection="Left" CustomInfoHTML="总数：%RecordCount%，共 %PageCount% 页，当前为第%CurrentPageIndex%页"
                            HorizontalAlign="right" FirstPageText="首页" PrevPageText="上页" NextPageText="下页"
                            LastPageText="末页" CssClass="dg_pagestyle" PageSize="15">
                        </diy:AspNetPager>    
                    </td>
                    <td Width="15%">，每页<asp:TextBox ID="PageSize" runat="server" style="width: 30px" Text="15" onblur="CheckPageSize(this)"></asp:TextBox>条记录。</td>
                </tr>
            </table>
            <Triggers>
            <%--<asp:PostBackTrigger ControlID="lbtnAddMember" />
            <asp:PostBackTrigger ControlID="lbtnExport" />--%>
            </Triggers>
        </ContentTemplate>
    </asp:UpdatePanel>
         
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"
    DynamicLayout="true">
    <ProgressTemplate>
        <uc1:Loading ID="Loading1" runat="server" />
    </ProgressTemplate>
</asp:UpdateProgress>